package com.qut.dao;

import java.util.List;
import java.util.Map;

import com.neu.dao.BaseDao;

public class controller_list_Dao extends BaseDao {


	public List<Map<String, Object>> findby_controller_list(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list;" ;
		list=super.executeQuery(sql);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_itemid(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_itemid;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	
	public List<Map<String, Object>> findby_controller_list_by_intime_desc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_intime_desc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_intime_asc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_intime_asc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_outtime_desc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_outtime_desc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_outtime_asc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_outtime_asc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_flyman_id_desc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_flyman_id_desc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_flyman_id_asc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_flyman_id_asc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_item_status_desc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_item_status_desc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> findby_controller_list_by_item_status_asc(){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				" FROM controller_list_by_item_status_asc;" ;
		list=super.executeQuery(sql);
		//System.out.println(list);
		return list;}
	public List<Map<String, Object>> find(String item_id,String item_status,String item_intime,String item_outtime,String flyman_id){
		List<Map<String, Object>> list=null;
		String sql="SELECT *"+
				"FROM controller_list "+
				"WHERE goods_id LIKE'%"+item_id
				+ "%'  OR goods_id IS NULL "
				+ "AND goods_intime LIKE'%"+item_intime
				+ "%' OR goods_intime IS NULL "
				+ "AND goods_outtime LIKE'%"+item_outtime
				+ "%' OR goods_outtime IS NULL "
				+ "AND del_id LIKE'%"+flyman_id
				+ "%' OR del_id IS NULL "
				+ "AND goods_state LIKE'%"+item_status
				+ "%' OR goods_state IS NULL;" ;
		list=super.executeQuery(sql);
		
		return list;}
	public int controller_change3(String item_id,String flyman_id ) {
		int row=0;
		String sql="UPDATE tbl_fund_once"
				+" SET del_id="+flyman_id
				+" WHERE goods_id='"+item_id
				+"'";
		row=super.executeUpdate(sql);
	
		return row;
	}
	public int controller_change2(String item_id,String item_status ) {
		int row=0;
		String sql="UPDATE tbl_goods_state"
				+" SET goods_state="+item_status
				+" WHERE goods_id='"+item_id
				+"'";
		row=super.executeUpdate(sql);
	
		return row;
	}
	public int controller_change1(String item_id,String flyman_id ) {
		int row=0;
		
		String sql="UPDATE tbl_fund_once"
				+" SET del_id="+flyman_id
				+" WHERE goods_id='"+item_id
				+"'";
		row=super.executeUpdate(sql);
	
	
		return row;
	}
}

